<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var  total = 1 ;
        function feb(a,b,sum){
            if ( a + b < sum ){
                var temp = a ; 
                var a = a + b ; 
                var b = temp ;
                if ( a % 2 == 0 ){
                    total = total + a ; 
                } 
                feb(a,b,sum) ; 
            } else {
                console.log(total);
                return total ; 
            }
        }
        feb(1,1,4000000);
        // console.log(feb(1,1,10));
    </script>
</body>
</html>